package org.dtrd.modules.service.entity.bean;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.service.entity.po.DtrdRlPatientServiceDetail;

import java.util.Date;
import java.util.List;

/**
 * @author qr
 * @date 2022/1/6 15:24
 */
@ApiModel("服务详情项目")
@Getter
@Setter
public class ServiceDetailItem {

    @ApiModelProperty("记录id")
    private Integer dataId;

    @ApiModelProperty("服务id")
    private Integer serviceId;
    @ApiModelProperty("服务项目名字")
    private String serviceName;

    @ApiModelProperty("完成情况")
    private Integer status;

    @ApiModelProperty("服务周期")
    private Integer period;

    /**
     * 服务周期单位 1-天 2-月 3-年 4-周
     */
    private Integer periodUnit;

    @ApiModelProperty("患者评分")
    private Integer score;
    @ApiModelProperty("患者标签集合")
    private List<String> tagName;

    @ApiModelProperty("执行人")
    private String executor;

    @ApiModelProperty("完成时间")
    @JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8")
    private Date finishedTime;

    @ApiModelProperty("备注")
    private String remark;

    public ServiceDetailItem parseFromPO(DtrdRlPatientServiceDetail po) {
        dataId = po.getDataId();
        status = po.getStatus();
        serviceId = po.getServiceId();
        serviceName = po.getServiceName();
        finishedTime = po.getFinishedTime();
        remark = po.getRemark();
        score = po.getPatientEvaluation();
        period = po.getPeriod();
        periodUnit=po.getPeriodUnit();
        return this;
    }
}
